Garmin: don't free received waypoints if no waypoints received.
authorrobertl <robertl>
Mon, 17 Mar 2008 16:35:25 +0000 (16:35 +0000)
committerrobertl <robertl>
Mon, 17 Mar 2008 16:35:25 +0000 (16:35 +0000)
garmin.c

index 9179e68a1e74175f5d7e5d746fc00f5da6e747af..7048bd9b067d4fed2e9eff9a8bb2361bd9ee07a5 100644 (file)
--- a/garmin.c
+++ b/garmin.c
@@ -317,7 +317,9 @@ waypt_read(void)
                waypt_add(wpt_tmp);
                GPS_Way_Del(&way[i]);
        }
-       xfree(way);
+       if (way) {
+               xfree(way);
+       }
 }
 
 static